package com.bjdd.jdy.ui.videoExam;

import com.bjdd.jdy.base.BaseResult;
import com.bjdd.jdy.entity.ResourceUrlBean;
import com.bjdd.jdy.util.Api;
import com.bjdd.jdy.util.RxSchedulers;

import rx.Observable;

/**
 * Created by Administrator on 2017/5/26.
 */

public class VideoExamModel implements VideoExamContract.Model{
    @Override
    public Observable<BaseResult<String>> commitExam(String token, int chapter, String carrierId) {
        return Api.getInstance().service
                .passExam(token,chapter,carrierId)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<ResourceUrlBean>> getVideoURL(String token, int type) {
        return Api.getInstance().service
                .getExamResource(token,type)
                .compose(RxSchedulers.io_main());
    }
}
